import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n= sc.nextInt();
        int count=0;
        while(n>0){
            if((n&1)==1){
                count++;
            }
            n>>=1;
        }
        System.out.println(count);
    }
    public static void main5(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        int num=maxdivisor(a,b);
        System.out.println(num);
    }
    public static int maxdivisor(int a,int b){
        int max=0;
        if(a<b){
            for(int i=1;i<=a;i++){
                if(a%i==0&&b%i==0){
                    max=Math.max(max,i);
                }
            }
        }
        else{
            for (int i=1;i<=b;i++){
                if(a%i==0&&b%i==0){
                    max=Math.max(max,i);
                }
            }
        }
        return max;
    }
    public static void main4(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        double sum=0;
        for(int i=1;i<=n;++i){
            if(i%2!=0){
                sum+=1/i;
            }
            else{
                sum-=1/i;
            }
        }
        System.out.println(sum);
    }
    public static void main3(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int sum=0;
        for(int i=100;i<=n;++i){
            int s=i;
            sum=0;
            while(s>0){
                int a=s%10;
                int c=(int)Math.pow(a,3);
                sum+=c;
                s/=10;
            }
            if(sum==i){
                System.out.println(i);
            }
        }
    }
    public static void main2(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        boolean a=delightnum(n);
        System.out.println(a);
    }
    public static boolean delightnum(int n){
        for(int i=2;i<n;++i){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }
    public static void main1(String[] args) {
        int i = 0;
        int count = 0;
        for (i = 0; i <= 100; ++i) {
            int m = i;
            while (m > 0) {
                int n = m % 10;
                if (n == 9) {
                    count++;
                }
                m /= 10;
            }
        }
        System.out.println(count);
    }
}